package com.lyt.springboot.util.algorithm;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;


public class S39 {
    @Test
    public void test() {
        List<Integer> list  = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);

        //降序
        Collections.sort(list, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1-o2;
            }
        });


        Collections.sort(list,(Integer o1,Integer o2)->{
            return 01-o2;
        });
    }
}
